#include<iostream>
#include <ctime>
#include <thread>
#include "../source/log.h"
#include "../source/util.h"
#include "../source/singleton.h"

int main(void)
{
    framework::Logger::ptr Logger(new framework::Logger);
    Logger->addAppender(framework::LogAppender::ptr(new framework::StdoutLogAppender));
    //std::string path = "./file";
    //Logger->addAppender(framework::LogAppender::ptr(new framework::FileLogAppender(path)));
    
    // framework::LogEvent::ptr event(new framework::LogEvent(__FILE__, __LINE__, 0,
    //     framework::GetThreadId(), framework::GetFiberId(), time(0)));

    //Logger->log(framework::LogLevel::DEBUG,event);
    //std::cout << "hello world" << std::endl;

    //std::cout << "===========================================" std::endl;

    FRAMEWORK_LOG_INFO(Logger) << "test macro";
    FRAMEWORK_LOG_FMT_ERROR(Logger,"test macro fmt error %s","hello");

    auto l = framework::LoggerMgr::GetInstance()->getLogger("xx");
    FRAMEWORK_LOG_INFO(l) << "xxx";
    return 0;
}

